package com.ruoyi.supplier.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.supplier.mapper.GysMainCategoryMapper;
import com.ruoyi.supplier.domain.GysMainCategory;
import com.ruoyi.supplier.service.IGysMainCategoryService;

/**
 * 品项类别Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-15
 */
@Service
public class GysMainCategoryServiceImpl implements IGysMainCategoryService 
{
    @Autowired
    private GysMainCategoryMapper gysMainCategoryMapper;

    /**
     * 查询品项类别
     * 
     * @param id 品项类别主键
     * @return 品项类别
     */
    @Override
    public GysMainCategory selectGysMainCategoryById(Long id)
    {
        return gysMainCategoryMapper.selectGysMainCategoryById(id);
    }

    /**
     * 查询品项类别列表
     * 
     * @param gysMainCategory 品项类别
     * @return 品项类别
     */
    @Override
    public List<GysMainCategory> selectGysMainCategoryList(GysMainCategory gysMainCategory)
    {
        return gysMainCategoryMapper.selectGysMainCategoryList(gysMainCategory);
    }

    /**
     * 新增品项类别
     * 
     * @param gysMainCategory 品项类别
     * @return 结果
     */
    @Override
    public int insertGysMainCategory(GysMainCategory gysMainCategory)
    {
        gysMainCategory.setCreateTime(DateUtils.getNowDate());
        return gysMainCategoryMapper.insertGysMainCategory(gysMainCategory);
    }

    /**
     * 修改品项类别
     * 
     * @param gysMainCategory 品项类别
     * @return 结果
     */
    @Override
    public int updateGysMainCategory(GysMainCategory gysMainCategory)
    {
        gysMainCategory.setUpdateTime(DateUtils.getNowDate());
        return gysMainCategoryMapper.updateGysMainCategory(gysMainCategory);
    }

    /**
     * 批量删除品项类别
     * 
     * @param ids 需要删除的品项类别主键
     * @return 结果
     */
    @Override
    public int deleteGysMainCategoryByIds(Long[] ids)
    {
        return gysMainCategoryMapper.deleteGysMainCategoryByIds(ids);
    }

    /**
     * 删除品项类别信息
     * 
     * @param id 品项类别主键
     * @return 结果
     */
    @Override
    public int deleteGysMainCategoryById(Long id)
    {
        return gysMainCategoryMapper.deleteGysMainCategoryById(id);
    }
}
